#ifndef _Normal3_H_
#define _Normal3_H_

#pragma once

#include "Vector3.h"

class Normal3 : public Vector3 {
public:
	Normal3() : Vector3() {}
	Normal3(Double x, Double y, Double z) : Vector3(x, y, z) {
		normalize();
	}
	Normal3(const Vector3 &v) : Vector3(v) {
		normalize();
	}
	Normal3(const Normal3 &v) : Vector3(v) {}

	inline void operator=(const Normal3 & v) {
		x = v.x, y = v.y, z = v.z;
	}

	inline void operator=(const Vector3 & v) {
		x = v.x, y = v.y, z = v.z;
		normalize();
	}

	inline Normal3 operator-() const {
		Normal3 normal(*this);
		normal.x = -normal.x;
		normal.y = -normal.y;
		normal.z = -normal.z;
		return normal;
	}

	inline std::string str() const {
		std::ostringstream ss;
		ss << "Normal3(" << x << "," << y << "," << z << ")";
		return ss.str();
	}

	~Normal3() {}
};

#endif // _Normal3_H_